//
//  Global.h
//  GKBHouse
//
//  Created by  on 12-8-11.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#define GKBHouse_Global_h
#import <QuartzCore/QuartzCore.h>
#import "OperationTip.h"
#import "MenuController.h"
#import "AppFile.h"
#import "ExFrame.h"
#import "HouseButton.h"
#import "DeviceView.h"
#import "RoomView.h"
#import "GKBMainController.h"
#import "GKBNavigationBar.h"
#import "LoginController1.h"
#import "WebServices.h"
#import "SystemSettting.h"
#import "SceneSetting.h"
#import "UIColor+GNExtension.h"

#import "UIViewController+Category.h"
#import "UIView+ViewFrameGeometry.h"

#import "LampController.h"
#import "AirconditionController.h"

#import "NewTVController.h"

#import "DVDController.h"

#import "MBProgressHUD.h"

#import "Masonry.h"
#define IOS7_OR_LATER  ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )

#define kScreenHeight [[UIScreen mainScreen] bounds].size.height
#define kScreenWidth [[UIScreen mainScreen] bounds].size.width

#define DEVICE_HEIGHT MAX(kScreenHeight, kScreenWidth)

#define DEVICE_WIDTH MIN(kScreenHeight, kScreenWidth)
//屏幕适配比例
#define ScreenScale [UIScreen mainScreen].bounds.size.width / 320.0
#define DEVICE_IS_4INCHES ([[UIScreen mainScreen] bounds].size.height == 568)




//view的fram

#define viewFramHeight self.view.frame.size.height
#define viewFrameWigh self.view.frame.size.wigh
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

/*               ********** 判断系统版本*********               */

#define IOS9 [[[UIDevice currentDevice] systemVersion]floatValue]>=9
#define IOS8 [[[UIDevice currentDevice] systemVersion]floatValue]>=8
#define IOS7 [[[UIDevice currentDevice] systemVersion]floatValue]>=7

/*               ********** 判断系统版本*********               */

// 像素转换
#define kFONT_SIZE_FROM_PX_VALUE(pxValue) ((pxValue+3.0f)*0.5f)



#define ZDScreenSize [UIScreen mainScreen].bounds.size


#ifdef __OBJC__

#ifdef DEBUG

#define ZDLog(...) NSLog(__VA_ARGS__)

#else

#define ZDLog(...)

#endif


#define ZDApp [UIApplication sharedApplication]

#define ZDScreenSize [UIScreen mainScreen].bounds.size

#define ZDColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]

#define ZDSameColor(r) ZDColor(r, r, r)

#define ZDFont(s) [UIFont fontWithName:@"FZLTXHK--GBK1-0" size:(s)]

#define ZDScreenSize [UIScreen mainScreen].bounds.size



#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define rgba(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]

#define isiOS7 ([UIDevice currentDevice].systemVersion.doubleValue >= 7.0)
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone)

//获取屏幕宽度
#define screenWide [UIScreen mainScreen].bounds.size.width
//获取屏幕高度
#define screenHeight [UIScreen mainScreen].bounds.size.height

//颜色
#define COLOR(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]
//#define LOGCOLOR COLOR(105.0, 181.0, 88.0, 1.0) //登录
#define LOGCOLOR COLOR(26,183,80,1.0)
#define TEXTFIELDCOLOR COLOR(255, 255, 255, 1.0)//输入框背景颜色
#define navigationBarColor COLOR(37, 145, 235,1.0)
#define LOGBACKGROUND [Common colorWithHexString:@"#f1f1f1"] // 登录注册底层颜色

// 判断是否为ios7
#define isiOS7 ([[[UIDevice currentDevice]systemVersion]floatValue]>=7.0)
#define isBigIos7  ([[[UIDevice currentDevice] systemVersion] floatValue] >=7.0)

#if __IPHONE_8_0 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
#define IS_IOS8_OR_GREATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
#else
#define IS_IOS8_OR_GREATER (NO)
#endif

// 判断是否为iphone5
#define isIPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
// 判断是否无ipad
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
/**************************** APP接口 *****************************************/

//#define DEV
//#define TEST
#define ONLINE

//沙盒测试
#define BUY_VERIFY_RECEIPT_URL @"https://sandbox.itunes.apple.com/verifyReceipt"

//#define RIGHT_EQUIPMENTS @"right_equipments"
//#define LEFT_EQUIPMENTS @"left_equipments"


#endif
